
<meta charset="utf-8" />
<form class="form-horizontal" role="form"
	onsubmit="return submitForm(this);" action="">
	<input type="hidden" name="casType" id="casType">
	<input type="hidden" name="casAudit" id="casAudit">
	<input type="hidden" name="whiteCardNo" id="whiteCardNo">
	<input type="hidden" id="custHeadPic" name="custHeadPic"/>
	<input type="hidden" id="idCardFront" name="idCardFront"/>
	<input type="hidden" id="bankCardFrond" name="bankCardFrond"/>
	<input type="hidden" id="paySignPic" name="paySignPic">
	<br />
	<!-- 
	 * Input属性说明:
	 * validate="true"  是否需要验证字段
	 * msg="错误时提示信息"        
	 * datatype="数据类型"
	-->
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 提现订单号 ： </label>
		<div class="col-sm-4">
			<input type="text" id="casOrdNo" name="casOrdNo"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 商户编号 ： </label>
		<div class="col-sm-4">
			<input type="text" id="custId" name="custId"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 收款人名称 ： </label>
		<div class="col-sm-4">
			<input type="text" id="custName" name="custName" readonly="readonly"
				class="col-xs-10 col-sm-7" />
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 订单状态 ： </label>
		<div class="col-sm-4">
			<select rel="obj.CASORDSTATUS" location="local" name="ordStatus"
				id="casOrdStatus" readonly="readonly"
				style="width: 120px; vertical-align: middle;">
			</select>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">订单金额： </label>
		<div class="col-sm-4">

			<input type="text" id="ordAmt" name="ordAmt"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">手续费： </label>
		<div class="col-sm-4">

			<input type="text" id="fee" name="fee" class="col-xs-10 col-sm-7"
				readonly="readonly" />
		</div>

	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">服务费： </label>
		<div class="col-sm-4">

			<input type="text" id="serviceFee" name="serviceFee"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">到账金额 ： </label>
		<div class="col-sm-4">

			<input type="text" id="netrecAmt" name="netrecAmt"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">结算银行卡号： </label>
		<div class="col-sm-4">
			<input type="text" id="cardNo" name="cardNo"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>
		
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">结算银行名称： </label>
		<div class="col-sm-4">

			<input type="text" id="issNam" name="issNam"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">支付银行卡号： </label>
		<div class="col-sm-4">
			<input type="text" id="payCardNo" name="payCardNo"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>
		
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">支付银行名称： </label>
		<div class="col-sm-4">

			<input type="text" id="payIssnam" name="payIssnam"
				class="col-xs-10 col-sm-7" readonly="readonly" />
		</div>

	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">订单时间： </label>
		<div class="col-sm-4">
			<input type="text" id="casDate" name="casDate"
				class="col-xs-10 col-sm-7" init-format="dateFormat('{value}')"
				readonly="readonly" />
		</div>
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">完成时间： </label>
		<div class="col-sm-4">
			<input type="text" id="sucDate" name="sucDate"
				init-format="dateFormat('{value}')" class="col-xs-10 col-sm-7"
				readonly="readonly" />
		</div>
	</div>
	<div class="form-group" id="auditCardName">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">审核人： </label>
		<div class="col-sm-4">
			<input type="text" id="auditName" name="auditName"
				class="col-xs-10 col-sm-7" 
				readonly="readonly" />
		</div>
	</div>
	 
	<div id="whiteCardInf">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 头像照片：
			</label>
			<div class="col-sm-5">
				<span class=""> <img id="head" alt="" src="" width="200%">
				</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				身份证正面照片： </label>
			<div class="col-sm-5">
				<span class=""> <img id="front" alt="" src="" width="200%">
				</span>
			</div>
		</div>
		<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1">持卡人银行账号： </label>
		<div class="col-sm-4">
			<input type="text" id="whiteCardNo" name="whiteCardNo"
				class="col-xs-10 col-sm-7" readonly="readonly"  style="font-size:38px;width:500px"/>
		</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				银行卡正面照片： </label>
			<div class="col-sm-5">
				<span class=""> <img id="cardFront" alt="" src="" width="200%">
				</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				银行卡正面照片： </label>
			<div class="col-sm-4">
				<select id="refuseReason" style="width: 120px; vertical-align: middle;">
					<option value="">----请选择----</option>
					<option value="字迹不清晰">字迹不清晰</option>
					<option value="照片模糊">照片模糊</option>
					<option value="与刷卡银行卡不一致">与刷卡银行卡不一致</option>
					<option value="照片与交易银行卡不一致">照片与交易银行卡不一致</option>
					<option value="照片与身份证照片不一致">照片与身份证照片不一致</option>
				</select>
		</div>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right">
			电子签名 ：</label>
		<div class="col-sm-2">
			<span class="">
				<img id="paySignPicSrc" name="paySignPicSrc"  src="" width="200%" >
			</span>
		</div>
	</div>

	<div class="form-actions align-right  form-button-box"
		style="margin-top: 10px">
			<button id="auditThrough" class="btn" type="button" onclick="auditCas('1');">
				 审核通过
			</button>
			<button id="auditRefuse" class="btn" type="button" onclick="auditCas('2');">
				 审核不通过
			</button>
		<button class="btn" type="button"
			onclick="javascript:dialog.close(this);">关闭</button>
	</div>
</form>
<script type="text/javascript">
	$(document).ready(function() {
		var time = setInterval(function(){
			if($("#casAudit",$("#dlg-agentEdit")).val()!=''){
				clearInterval(time);
				initWhiteCardInf();
			}
		},100);
		setTimeout(setPic, 500);
	});
	
	function setPic(){
		document.getElementById("paySignPicSrc").src ="mpbase/pic/view2.do?picid="+$("#paySignPic").val();
	}

	function initWhiteCardInf() {
		if($("#casAudit",$("#dlg-agentEdit")).val()==1 || $("#casAudit",$("#dlg-agentEdit")).val()==2){
			$("#auditThrough").remove();
			$("#auditRefuse").remove();
		}
		if($("#casType",$("#dlg-agentEdit")).val()==01){
			$("#whiteCardInf").remove();
			$("#auditCardName").remove();
		}
		document.getElementById("head").src = "mpbase/pic/view2.do?picid=" + $("#custHeadPic").val();
		document.getElementById("front").src = "mpbase/pic/view2.do?picid=" + $("#idCardFront").val();
		document.getElementById("cardFront").src = "mpbase/pic/view2.do?picid=" + $("#bankCardFrond").val();
	}

	function submitForm(obj) {

		//自定义匿名回调函数。 系统默认回调函数：dialogAjaxDone
		return validateCallback(obj, function(result) {
			if (result.rspcod == 200) {
				msg.alert("提示", result.rspmsg, 'correct');
				$("#grid-table").trigger("reloadGrid");
				dialog.close(obj);
			} else {
				msg.alert("错误", result.rspmsg + " 错误代码：" + result.rspcod,
						'error');
			}
		});
	}
	
	function auditCas(auditResult){
		var cardNo = $("#whiteCardNo",$("#dlg-agentEdit")).val();
		var casOrdNo = $("#casOrdNo",$("#dlg-agentEdit")).val();
		var refuseReason = $("#refuseReason",$("#dlg-agentEdit")).val();
		$.ajax({
			type : "post",
			url : "mpomng/prdInf/auditCasPrd.do",
			data:{"cardNo":cardNo,"casOrdNo":casOrdNo,"auditResult":auditResult,"refuseReason":refuseReason},
			dataType : 'json',
			success : function(result) {
				if(result.rspcod== 200){
					msg.alert("提示",result.rspmsg,'correct');
					$("#grid-table").trigger("reloadGrid");
					dialog.closeById('dlg-agentEdit');
				}else{
					msg.alert("错误",result.rspmsg,'error');
				}
			},
			error : function(XMLHttpRequest, textStatus) {
				msg.alert("错误", "错误代码：" + XMLHttpRequest.status + ",错误描述："+ textStatus, 'error');
			}
		});
	}
</script>
